<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticles extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {

            $table->increments('id');
            $table->tinyInteger('category_id')->unsigned();
            $table->string('title', 100)->default('');
            $table->string('author', 15)->default('');
            $table->text('content');
            $table->text('html');
            $table->string('description', 255)->default('');
            $table->string('keywords', 255)->default('');
            $table->string('cover', 255)->default('');
            $table->tinyInteger('is_top')->unsigned()->default('0')->comment('0否 1是');
            $table->unsignedInteger('click')->default('0');
            $table->tinyInteger('display')->unsigned()->default('1')->comment('0否 1是');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
